package com.ferryc.modules.sys.entity.param;

import java.util.Date;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.ferryc.commons.entity.DataEntity;
import com.ferryc.constant.ValidatorConstant;
import com.ferryc.modules.sys.entity.SysUser;

/**
 * 
 * 类名: SysUsers <br/>
 * 作用： <br/>
 * 方法： <br/>
 * 创建者: Ferry C <br/>
 * 添加时间: 2017年12月04日 10:14:23 <br/>
 * 
 */
public class SysUserParam extends DataEntity<SysUserParam> {
	private static final long serialVersionUID = 1L;

	/** LoginName */
	@NotBlank(message = ValidatorConstant.ERROR_LOGIN_NAME)
	@Pattern(regexp = "[a-zA-Z0-9_]*", message = ValidatorConstant.ERROR_LOGIN_NAME)
	@Length(min = 2, max = 20, message = ValidatorConstant.ERROR_LOGIN_NAME)
	private String loginName;

	/** RealName */
	@NotBlank(message = ValidatorConstant.ERROR_REAL_NAME)
	@Length(min = 2, max = 20, message = ValidatorConstant.ERROR_REAL_NAME)
	private String realName;

	/** 密码 */
	@NotBlank(message = ValidatorConstant.ERROR_PSWD)
	private String password;

	/** 密码加密盐 */
	private String salt;

	/** 工号 */
	@Pattern(regexp = "[a-zA-Z0-9_]*", message = ValidatorConstant.ERROR_USER_NO)
	private String no;

	/** 邮箱 */
	@Email(message = ValidatorConstant.ERROR_EMAIL)
	private String email;

	/** 电话 */
	@Pattern(regexp = "(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1}))+\\d{8})", message = ValidatorConstant.ERROR_MOBILE)
	private String mobile;

	/** LoginIp */
	private String loginIp;

	/** LoginDate */
	private Date loginDate;

	/** OrganizationId */
	@NotBlank(message = ValidatorConstant.ERROR_ORG_ID)
	private String organizationId;

	/** 角色ID */
	@NotBlank(message = ValidatorConstant.ERROR_USER_ROLE)
	private String roleId;

	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getRealName() {
		return this.realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return this.salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getNo() {
		return this.no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getLoginIp() {
		return this.loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	public Date getLoginDate() {
		return this.loginDate;
	}

	public void setLoginDate(Date loginDate) {
		this.loginDate = loginDate;
	}

	public String getOrganizationId() {
		return this.organizationId;
	}

	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public SysUser toSysUsers() {
		SysUser po = new SysUser();
		po.setId(this.id);
		po.setLoginName(this.loginName);
		po.setRealName(this.realName);
		po.setPassword(this.password);
		po.setSalt(this.salt);
		po.setNo(this.no);
		po.setEmail(this.email);
		po.setMobile(this.mobile);
		po.setStatus(this.status);
		po.setLoginIp(this.loginIp);
		po.setLoginDate(this.loginDate);
		po.setCreateBy(this.createBy);
		po.setCreateDate(this.createDate);
		po.setUpdateBy(this.updateBy);
		po.setUpdateDate(this.updateDate);
		po.setRemarks(this.remarks);
		po.setDelFlag(this.delFlag);
		po.setOrganizationId(this.organizationId);
		po.setLimit(this.limit);
		po.setOffset(this.offset);
		po.setRoleId(this.roleId);
		po.setLikeName(this.likeName);
		return po;
	}

}